import React from 'react';

import { FlowProvider } from './FlowContext';
import Main from './Main';

function FlowVersion({ match, location }) {
  const {
    params: { processId },
  } = match;

  const {
    query: { versionId, readOnly = 'false', tabName },
  } = location;

  return (
    <FlowProvider value={{ processId, versionId, readOnly: readOnly === 'true', tabName }}>
      <Main />
    </FlowProvider>
  );
}

export default FlowVersion;
